package com.zzyl.serve.controller.member;


import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import com.zzyl.serve.vo.MemberOrderProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "服务项接口")
@RequestMapping("/member/orders")
public class MemberOrderProjectController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    @GetMapping("/project/page")
    @ApiOperation("服务下单展示")
    public TableDataInfo getProjectPage(NursingProject nursingProject) {
        List<NursingProject> nursingProjects = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(nursingProjects);
//        MemberOrderProjectVo vo = nursingProjectService.getProjectPage(nursingProject);
//        return vo;
    }

    @GetMapping("/project/{id}")
    @ApiOperation("根据id查询项目")
    public R<NursingProject> getProjectById(@PathVariable Integer id) {
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return R.ok(nursingProject);
    }

}
